package com.wctj.api.business.common.config;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;


/**
 * 登录密码配置
 * @author carol
 */
@Configuration
@ConfigurationProperties(prefix = "mall.password")
@Data
@Slf4j
public class PasswordProperties {
    /**
     * 密码输错次数
     */
    private Integer errorCount = 5;
    /**
     * 冻结时间S 10分钟
     */
    private Integer stopSecond = 600;

    @PostConstruct
    public void init() {
        if (errorCount == null && stopSecond == null) {
            errorCount = 5;
            stopSecond = 600;
        }
    }
}
